#include <assert.h>
#include "companydao_factory.h"
#include "companydao_stub4web.h"
#include "companydao_stub4app.h"
//#include "companydao.h"

using namespace erp::company::dao;

bool CCompanyDaoFactory::s_CompanyDaoInit = false;

ICompanyDao* CCompanyDaoFactory::GetObject(enum ObjType_T obj_type)
{
    switch(obj_type)
    {
    case STUB4APP:
        return (new CCompanyDaoStub4App);
/*适应container3
    case POCO:
    {
        if(!s_CompanyDaoInit)
        {
            int iRetCode = CCompanyDao::Initialize();
            assert(iRetCode == 0);
            s_CompanyDaoInit = true;
        }   	
        return (new CCompanyDao);
	}*/
    default:
        assert(0);
    };
    return NULL;
}

ICompanyDaoAsyc* CCompanyDaoFactory::GetAsycObject()
{
	return (new CCompanyDaoStub4App);
}
